package org.gw.ylc.base.context;

import org.gw.ylc.base.AppProvider;
import org.gw.ylc.base.model.UserInfo;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;

import java.io.Serializable;
import java.util.LinkedHashSet;
import java.util.Set;

public class RequestContext implements Serializable {

	private static final long serialVersionUID = 5268394157447372322L;

	private String clientIP;

	private UserInfo user;

	private Set<Roles> availableRoles = new LinkedHashSet<Roles>();

	private PageRequest pageRequest;

	private AppProvider appProvider;

	public String getClientIP() {
		return clientIP;
	}

	public void setClientIP(String clientIP) {
		this.clientIP = clientIP;
	}

	public UserInfo getUser() {
		return user;
	}

	public void setUser(UserInfo user) {
		this.user = user;
	}

	public Set<Roles> getAvailableRoles() {
		return availableRoles;
	}

	public void setAvailableRoles(Set<Roles> availableRoles) {
		this.availableRoles = availableRoles;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public PageRequest getPageRequest() {
		return pageRequest;
	}

	public Pageable getPageable() {
		return pageRequest;
	}

	public void setPageRequest(PageRequest pageRequest) {
		this.pageRequest = pageRequest;
	}

	public AppProvider getAppProvider() {
		return appProvider;
	}

	public void setAppProvider(AppProvider appProvider) {
		this.appProvider = appProvider;
	}

}
